# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-sphinxcontrib-httpdomain
pkgname=('python2-sphinxcontrib-httpdomain' 'python-sphinxcontrib-httpdomain')
_pkgname=sphinxcontrib-httpdomain
pkgver=1.8.1
pkgrel=4
pkgdesc='Sphinx domain for documenting HTTP APIs.'
arch=('any')
url='https://pypi.org/project/sphinxcontrib-httpdomain/#files'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('197c44fd9bdc146f49c6a0aa365a5bd49b76f712ae89082be3761aa21c99683279090fc274308ca199fb7efae5a2d713be4531b90747f504860f36a01ee4c52b')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-sphinxcontrib-httpdomain() {
  depends=('python2' 'python2-sphinx' 'python2-six')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-sphinxcontrib-httpdomain() {
  depends=('python' 'python-sphinx' 'python-six')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

